I’m as of yet unable to query this endpoint with my Global Admin’s user-level API key, despite passing the requisite team_ids
or service_ids
filter. Note, I’ve tried both with and without the []
after team_ids
.
Attempt #1 Passing filter as query parameter
POST https://api.pagerduty.com/analytics/raw/incidents?team_ids=Team_ID
Accept: application/vnd.pagerduty+json;version=2
Authorization: Token token=User_API_Key
Content-Type: application/json
X-EARLY-ACCESS: analytics-v2
Raw cURL request code:
curl --request POST \
--url 'https://api.pagerduty.com/analytics/raw/incidents?team_ids=Team_ID' \
--header 'accept: application/vnd.pagerduty+json;version=2' \
--header 'authorization: Token token=User_API_Key' \
--header 'content-type: application/json' \
--header 'user-agent: vscode-restclient' \
--header 'x-early-access: analytics-v2'
Attempt #2 Passing filter as body parameter
POST https://api.pagerduty.com/analytics/raw/incidents
Accept: application/vnd.pagerduty+json;version=2
Authorization: Token token=User_API_Key
Content-Type: application/json
X-EARLY-ACCESS: analytics-v2
{ "team_ids": "Team_ID" }
Raw cURL request code:
curl --request POST \
--url `https://api.pagerduty.com/analytics/raw/incidents` \
--header 'accept: application/vnd.pagerduty+json;version=2' \
--header 'authorization: Token token=User_API_Key' \
--header 'content-type: application/json' \
--header 'user-agent: vscode-restclient' \
--header 'x-early-access: analytics-v2' \
--data '{ "team_ids": "Team_ID" }'
Resultant output for both attempts:
{
"errors": {
"invalid_parameter_key": "team_ids"
}
}
With an account-level API key and no team_ids
or service_ids
filter, the expected output is returned. I would expect the same behaviour with a Global Admin’s user-level API key.